The percent load or utilization of a CPU is often measured so that CPU parameters can be tuned to match the required workload. For example, it is advantageous to reduce the CPU clock frequency if the CPU is lightly loaded to reduce heat and active power dissipation in the CPU. When increased performance is needed, the CPU frequency can be boosted. Such frequency boosting is called a turbo mode. The typical method for measuring the load of a deployed CPU tracks the number of times a calibrated idle loop runs. This number is used to calculate how much time the CPU is waiting for application threads. This is often referred to as the global CPU load.
Frequency scaling of the CPU is one technique used to save power. Another technique uses built-in idle and clock gating of a CPU during idle time to save power while the CPU has nothing to do and is waiting for an interrupt.
There is a conflict between the frequency scaling and clock gating techniques. Measuring load via the calibrated idle loop to determine when to scale the frequency requires the idle loop to run continuously (spinning). On the other hand, the CPU needs to be halted using the clock gating technique.
Spinning in the idle loop technique will not give accurate power monitoring when the CPU is idled. Conceptually it is possible to monitor all application threads, including hardware interrupts, software interrupts/signals and tasks and then infer that the remaining time is idle time. Implementing this is clearly complex for some thread architectures and could be accomplished only at a high overhead cost. Known attempts to implement this using thread hook functions have given highly inaccurate results with accuracies of ±20%. Performing this type of instrumentation/profiling can give valuable information on activity of individual threads and is clearly useful in a development environment but it is typically not useful in a fully deployed application environment. Further, the instrumentation of all threads will lead to increased power drain.
The term interrupt service routine (ISR) refers to the ordinary CPU processing executed when an interrupt triggers, preempting the normal processing of the CPU. This could be an interrupt from a serial port indicating that new data has arrived and needs to be transferred to memory immediately, otherwise such new incoming data will over-write the data currently buffered in the serial port.